/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.project.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Malek
 */
@Entity
@Table(name = "CLIENT", catalog = "", schema = "ONECOMMERCE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Client.findAll", query = "SELECT c FROM Client c"),
    @NamedQuery(name = "Client.findByIdinscrit", query = "SELECT c FROM Client c WHERE c.idinscrit = :idinscrit"),
    @NamedQuery(name = "Client.findByNom", query = "SELECT c FROM Client c WHERE c.nom = :nom"),
    @NamedQuery(name = "Client.findByPrenom", query = "SELECT c FROM Client c WHERE c.prenom = :prenom"),
    @NamedQuery(name = "Client.findByLogin", query = "SELECT c FROM Client c WHERE c.login = :login"),
    @NamedQuery(name = "Client.findByPassword", query = "SELECT c FROM Client c WHERE c.password = :password"),
    @NamedQuery(name = "Client.findByAdresseinsc", query = "SELECT c FROM Client c WHERE c.adresseinsc = :adresseinsc"),
    @NamedQuery(name = "Client.findByTel", query = "SELECT c FROM Client c WHERE c.tel = :tel"),
    @NamedQuery(name = "Client.findByBanque", query = "SELECT c FROM Client c WHERE c.banque = :banque")})
public class Client implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDINSCRIT", nullable = false, precision = 22, scale = 0)
    private BigDecimal idinscrit;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "NOM", nullable = false, length = 50)
    private String nom;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "PRENOM", nullable = false, length = 50)
    private String prenom;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "LOGIN", nullable = false, length = 50)
    private String login;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "PASSWORD", nullable = false, length = 50)
    private String password;
    @Size(max = 50)
    @Column(name = "ADRESSEINSC", length = 50)
    private String adresseinsc;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TEL", nullable = false)
    private BigInteger tel;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "BANQUE", nullable = false, length = 50)
    private String banque;
    @JoinColumn(name = "IDINSCRIT", referencedColumnName = "IDINSCRIT", nullable = false, insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Prospect prospect;

    public Client() {
    }

    public Client(BigDecimal idinscrit) {
        this.idinscrit = idinscrit;
    }

    public Client(BigDecimal idinscrit, String nom, String prenom, String login, String password, BigInteger tel, String banque) {
        this.idinscrit = idinscrit;
        this.nom = nom;
        this.prenom = prenom;
        this.login = login;
        this.password = password;
        this.tel = tel;
        this.banque = banque;
    }

    public BigDecimal getIdinscrit() {
        return idinscrit;
    }

    public void setIdinscrit(BigDecimal idinscrit) {
        this.idinscrit = idinscrit;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAdresseinsc() {
        return adresseinsc;
    }

    public void setAdresseinsc(String adresseinsc) {
        this.adresseinsc = adresseinsc;
    }

    public BigInteger getTel() {
        return tel;
    }

    public void setTel(BigInteger tel) {
        this.tel = tel;
    }

    public String getBanque() {
        return banque;
    }

    public void setBanque(String banque) {
        this.banque = banque;
    }

    public Prospect getProspect() {
        return prospect;
    }

    public void setProspect(Prospect prospect) {
        this.prospect = prospect;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idinscrit != null ? idinscrit.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Client)) {
            return false;
        }
        Client other = (Client) object;
        if ((this.idinscrit == null && other.idinscrit != null) || (this.idinscrit != null && !this.idinscrit.equals(other.idinscrit))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.project.entities.Client[ idinscrit=" + idinscrit + " ]";
    }
    
}
